﻿using Platformer_Example.Content.Images.Player;
using Transformable_Engine_v2.Engine.GameObjects.Containers;
using Transformable_Engine_v2.Engine.Transformable_Math.Geometry;

namespace Platformer_Example.Controller.Map.Objects
{
    public class BoxPickup : BasePickable
    {
        private static readonly TE_Rectangle _pickupBox =
            new TE_Rectangle(0, 0, 0.99f, 0.99f, TE_Rectangle.Alignment.BottomMiddle).ToGridBound();

        protected override TE_Rectangle PickupBox
        {
            get { return _pickupBox; }
        }

        protected override Container GetObject()
        {
            return new ImageContainer
                       {
                           Sprite = SpritesheetObjects.GetSprite(SpritesheetObjects.Objects.Box),
                           Origin = TE_Rectangle.Alignment.BottomMiddle
                       };
        }

        protected override ImageContainer GetObjectHover()
        {
            return new ImageContainer
                       {
                           Sprite = SpritesheetObjects.GetSprite(SpritesheetObjects.Objects.BoxHover),
                           Origin = TE_Rectangle.Alignment.BottomMiddle,
                           Visible = false
                       };
        }

        public override BaseThrowable GetThrowableObject()
        {
            Die();
            return new BoxThrowable();
        }

        protected override TE_Rectangle CollisionWarp
        {
            get { return _pickupBox; }
        }

        public override TE_Rectangle GetCollisionBox()
        {
            return _pickupBox;
        }
    }
}